package dao

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name string `gorm:"type:varchar(20);not null;comment:用户名"`
}

type Goods struct {
	gorm.Model
	Name  string `gorm:"type:varchar(40);not null;comment:用户名"`
	Price int    `gorm:"type:int(11);not null;comment:价格"`
	State int    `gorm:"type:tinyint(1);default:1;not null;comment:1-上架,2-下架"`
	Img   string `gorm:"type:varchar(255);not null;comment:图片"`
}

type Payment struct {
	gorm.Model
	UserId  int `gorm:"type:int(11);not null;comment:用户ID"`
	GoodsId int `gorm:"type:int(11);not null;comment:商品ID"`
	Way     int `gorm:"type:tinyint(1);default:1;not null;comment:1-微信,2-支付宝"`
}

type Order struct {
	gorm.Model
	UserId  int `gorm:"type:int(11);not null;comment:用户ID"`
	GoodsId int `gorm:"type:int(11);not null;comment:商品ID"`
	Way     int `gorm:"type:tinyint(1);default:1;not null;comment:1-微信,2-支付宝"`
	Price   int `gorm:"type:int(11);not null;comment:价格"`
	Num     int `gorm:"type:int(11);not null;comment:数量"`
}
